<div>
	<div class="panel panel-primary text-center">
		<div class="panel-heading">
			<label class="font-160"><span class="glyphicon glyphicon glyphicon-file"></span> {{'letters' | translate}}</label>
		</div>
	</div>
	<div class="panel panel-info">
		<div class="panel-body" ng-controller="UploadFileCtrl">
			<div class="bot-10">
				<button type="button" class="btn btn-warning btn-sm" ng-click="generate()">
					<span class="glyphicon glyphicon-plus-sign"></span> {{'generateLetter' | translate}}
				</button>
				<span class="btn btn-sm btn-warning btn-file">
					<span class="glyphicon glyphicon-folder-open"></span> {{'selectFile' | translate}}<input type="file" file-model="myFile"/>
    			</span>
				<button type="button" class="btn btn-warning btn-sm" ng-disabled="fileName == null || fileName == ''" ng-click="uploadFile()">
					<span class="glyphicon glyphicon glyphicon-upload"></span> {{'attachFile' | translate}}
				</button>
				<span>
					<label>{{fileName}}</label>
				</span>
			</div>
			<message-error-panel ng-model="message" auto-close="true"></message-error-panel>
			<table class="table table-striped">
				<thead>
					<tr>
						<th>#</th>
						<th>{{'SinisterLetter.date' | translate}}</th>
						<th>{{'SinisterLetter.time' | translate}}</th>
						<th>{{'SinisterLetter.type' | translate}}</th>
						<th>{{'SinisterLetter.target' | translate}}</th>
						<th>{{'options' | translate}}</th>
					</tr>
				</thead>
				<tbody>
					<tr class="animate-pagination" ng-repeat="sinisterLetter in searchResults.results">
						<td>{{(searchResults.currentPage - 1) * searchResults.itemsPerPage + $index + 1}}</td>
						<td>{{sinisterLetter.created | date : 'dd/MM/yyyy'}}</td>
						<td>{{sinisterLetter.created | date : 'HH:mm:ss'}}</td>
						<td>{{'SinisterLetterType.' + sinisterLetter.type | translate}}</td>
						<td>{{sinisterLetter.target.surname}} {{sinisterLetter.target.name}}</td>
						<td class="vert-align"><a class="btn btn-warning btn-sm" ng-href="{{REST_PATH}}/file/download/{{sinisterLetter.file.id}}"><span class="glyphicon glyphicon-download"></span></a>
						</td>
					</tr>
				</tbody>
			</table>
			<search-result-pagination></search-result-pagination>
		</div>
	</div>
	<div class="center">
		<button class="btn btn-primary" translate="back" ng-click="$root.go('sinister/' + sinisterId)"></button>
	</div>
</div>